﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _4chanManager.Logic
{
    public static class Helpers
    {
        public delegate void MessageDelegate(string message);

        public delegate void ProgressChangedDelegate(int percent);

        public delegate void TaskCompletedDelegate();

        public delegate void ThreadStatusDelegate(bool? value);

        public static List<string> GetFilesInDirectory(string dirPath, string extension)
        {
            if(!string.IsNullOrEmpty(extension))
                return Directory.GetFiles(@dirPath).Where(f => f.ToLower().EndsWith(extension)).ToList();
            
            return Directory.GetFiles(@dirPath).ToList();
        }

        public static string CreateNewFilePath(string folder, string fileName, string fileExtension)
        {
            return folder + "\\" + fileName + fileExtension;
        }

        public static string UserAgentHeader
        {
            get { return "Mozilla/5.0 (Windows; Windows NT 5.1; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4"; }
        }
    }
}
